how was the pyramid built